package com.bq.server.core.mapper;

import com.bq.server.base.BaseMapper;
import com.bq.server.core.model.CadreDept;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author shchen
 */
public interface CadreDeptMapper extends BaseMapper<CadreDept> {
    void deleteByCadreId(@Param("cadreId") Long cadreId);

    default List<CadreDept> getCadreIdsByDeptId(Long id) {
        return this.lambdaQuery()
                .select(CadreDept::getCadreId)
                .eq(CadreDept::getDeptId, id)
                .list();
    }

    ;
}